import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:syn_4s/core/extension/build_context_extension.dart';
import 'package:syn_4s/core/extension/int_extension.dart';

import '../../ui/shared/app_theme.dart';

class ToastUtils{
  static void showToast(String toast){
    if (toast.isEmpty) {
      return;
    }
    Fluttertoast.showToast(
        msg: toast,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        timeInSecForIosWeb: 1,
        backgroundColor: AppTheme.toastBgColors,
        textColor: Colors.white,
        fontSize: 16.px
    );
  }

  static void showNetError(BuildContext context){
    showToast(context.l10n.network_error);
  }
}